home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / amislate / install_amislate < prev    next >
Text File  |  1995-08-05  |  6KB  |  160 lines

  1. ; Installation script for AmiSlate
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiSlate...")
  5.  
  6. (set TestSlateAssign (run "assign SlateRexx: EXISTS" (safe)))
  7. (if (> TestSlateAssign 0)
  8.     (set DefaultUpdate 0)    
  9.     (set DefaultUpdate 1)
  10. )
  11.  
  12. (set SlateUpdate
  13.       (askchoice
  14.          (prompt "Select which kind of install you want:")
  15.          (choices "First Time Install" "Update")
  16.          (default DefaultUpdate)
  17.          (help "If you've never installed AmiSlate on your system before, select First Time Install.  If you already have an earlier version, select Update")
  18.    ))
  19.       
  20.  
  21. (if (= SlateUpdate 0)
  22.     (
  23.         (set SlateDir
  24.             (askdir
  25.                 (prompt "Where would you like to install AmiSlate??\n(A drawer named \"AmiSlate\" will be created in the directory you select)")
  26.                 (help @askdir-help)
  27.                 (default "AmiTCP:")
  28.             )
  29.         )
  30.         (set NewDir (tackon SlateDir "AmiSlate"))
  31.         (makedir (NewDir) (infos))
  32.     )
  33.     (
  34.         (set NewDir
  35.             (askdir
  36.                 (prompt "Where is AmiSlate currently installed??\n(Select the drawer where the AmiSlate executable is located)")
  37.                 (help @askdir-help)
  38.                 (default "AmiTCP:")
  39.             )
  40.         )
  41.     )
  42. )
  43.  
  44. (set MyPrompt ("Copying files to %s." NewDir))
  45.  
  46. (if (= SlateUpdate 0)
  47.     (
  48.         ; direct copy, then assign to the subdir
  49.         (copyfiles
  50.             (prompt MyPrompt)
  51.             (help @copyfiles-help)
  52.             (source "")
  53.             (infos)
  54.             (pattern "~(Install#?)")
  55.             (dest NewDir)
  56.         )
  57.     )
  58.     (
  59.         ; assigns already made, must copy manually
  60.         (copyfiles
  61.             (prompt MyPrompt)
  62.             (help @copyfiles-help)
  63.             (source "")
  64.             (infos)
  65.             (pattern "(AmiSlate|Doc|ExampleRexx|Readme)")
  66.             (dest NewDir)
  67.         )
  68.         (copyfiles
  69.             (prompt "Copying ARexx files to SlateRexx:")
  70.             (help @copyfiles-help)
  71.             (source "SlateRexx")
  72.             (files)
  73.             (pattern "#?.(rexx|slatefont)")
  74.             (dest "SlateRexx:")
  75.         )
  76.         (copyfiles
  77.             (prompt "Copying script files to SlateScripts:")
  78.             (help @copyfiles-help)
  79.             (source "SlateScripts")
  80.             (files)
  81.             (pattern "#?")
  82.             (dest "SlateScripts:")
  83.         )
  84.     )
  85. )
  86.  
  87. (if (= SlateUpdate 0)
  88.  (
  89.     (set AssignString1 ("assign SlateRexx: %s/SlateRexx" NewDir ))
  90.     (run AssignString1)
  91.     (set AssignString2 ("assign SlateScripts: %s/SlateScripts\n" NewDir))
  92.     (run AssignString2)
  93.  
  94.     (set AssignString ("assign SlateRexx: %s/SlateRexx\nassign SlateScripts: %s/SlateScripts\n" NewDir NewDir))
  95.     (startup "AmiSlate"
  96.             (prompt "For correct operation, AmiSlate needs two assigns to be present.  These assigns are \n\nSlateRexx: and SlateScripts:\n\n and should be assigned to the installed directories with the same names.  Do you wish me to put the appropriate assigns in your s:user-startup?")
  97.             (help "Sometimes a remote AmiSlate client will request the local one to run an ARexx macro or a AmiSlate recording.  These assigns will be the default directories for these scripts.")
  98.             (command AssignString)
  99.     )
  100.     (run AssignString)
  101.  )
  102. )
  103.  
  104. (set TestAmiTCPAssign (run "assign AmiTCP: EXISTS" (safe)))
  105. (if (> TestAmiTCPAssign 0)
  106.     (message "\n\nAmiTCP does not appear to be set up on your system.  (Specifically, the assign AmiTCP: has not been made)  Because of this, I am unable to configure the amitcp:db/services and amitcp:db/inetd.conf files.\n\nIf you wish to use the network functions of AmiSlate, you will need to set up AmiTCP and install again.")
  107.     (
  108.         (run "delete t:AmiSlate.AppendMeToServices QUIET")
  109.         (if (= SlateUpdate 0)
  110.         (
  111.             (textfile
  112.                 (prompt "If you plan to be running AmiSlate in conjunction with AmiTCP, the line:\n\nAmiSlate      2955/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to append this line to that file?\n\n(Note: this does not check to see if the line is already in the file!  If you've installed AmiSlate before, skip this part)")
  113.                 (help "Including this line in your amitcp:db/services file tells AmiTCP's inet daemon that all requests on port 2955 should be sent to the AmiSlate program for further processing.  If this line is not included, you will not be able to receive AmiSlate requests from other people.")
  114.                 (dest "t:AmiSlate.AppendMeToServices")
  115.                 (append "\nAmiSlate    2955/tcp\n")
  116.                 (confirm)
  117.             )
  118.         
  119.             (set AddServiceString ("join amitcp:db/services t:AmiSlate.AppendMeToServices as t:AmiSlate.Temp1"))
  120.             (set UpdateServiceString ("copy t:AmiSlate.Temp1 amitcp:db/services"))
  121.         
  122.             (if (exists "t:AmiSlate.AppendMeToServices")
  123.                 ((run AddServiceString)
  124.                  (run UpdateServiceString)
  125.                  (run "delete t:AmiSlate.Temp1")
  126.                  (run "delete t:AmiSlate.AppendMeToServices")
  127.                 )
  128.             )
  129.                 
  130.             (set ExecFile (tackon NewDir "AmiSlate"))
  131.             (set InetDString (cat "AmiSlate stream tcp nowait root " ExecFile))
  132.             (set InetDPrompt ("Also, if you plan to be running AmiSlate in conjunction with AmiTCP, the line:\n\n%s\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to append this line to that file?  (Note: this does not check to see if the line is already in the file!  If you've installed AmiSlate before, skip this part)" InetDString))
  133.             (set InternalInetString (cat "\nAmiSlate    stream      tcp nowait root    " ExecFile))        
  134.             (run "delete t:AmiSlate.AppendMeToInetD QUIET")
  135.         
  136.             (textfile
  137.                 (prompt InetDPrompt)
  138.                 (help "Including this line in your amitcp:db/inetd.conf file tells AmiTCP which program to run whenever it gets an AmiTCP request.  It is important that the file path and name in this line reflect the location of the AmiSlate executable.")
  139.                 (dest "t:AmiSlate.AppendMeToInetD")
  140.                 (append InternalInetString)
  141.                 (confirm)
  142.             )
  143.         
  144.             (set AddInetString ("join amitcp:db/inetd.conf t:AmiSlate.AppendMeToInetD as t:AmiSlate.Temp2"))
  145.             (set UpdateInetString ("copy t:AmiSlate.Temp2 amitcp:db/inetd.conf"))
  146.         
  147.             (if (exists "t:AmiSlate.AppendMeToInetD")
  148.                 ((run AddInetString)
  149.                  (run UpdateInetString)
  150.                  (run "delete t:AmiSlate.Temp2")
  151.                  (run "delete t:AmiSlate.AppendMeToInetD")
  152.                 )
  153.             )
  154.         )
  155.         ) ;;;;end if Update=0
  156.     ) ;;; end if AmiTCP>0 else... 
  157. )
  158. (message "\n\nAmiSlate is now installed.  Reboot your Amiga (just to be certain all assigns are made, etc.) and try it out!")
  159.  
  160.